<template>
  <div class="tab">
    <div
      class="tab-item"
      @click="change(index,item)"
      v-for="(item, index) in tabList"
      :key="index"
      :class="[selectIndex === index ? 'tabActive' : '']"
    >
      {{ item.name }}
    </div>
  </div>
</template>

<script>
export default {
  name: "Tab",
  props: ["tabList"],
  components: {},
  data() {
    return {
      selectIndex: 0,
      // tabList: [
      //   { id: 1, name: "全部" },
      //   { id: 2, name: "待采纳" },
      //   { id: 3, name: "部分采纳" },
      //   { id: 4, name: "已采纳" },
      //   { id: 5, name: "超时未采纳" },
      //   { id: 6, name: "无效报价" },
      // ],
    };
  },
  methods: {
    change(index,item) {
      this.selectIndex = index;
      this.$emit("tabActive", item);
    },
  },
  created() {},
};
</script>
<style lang="scss" scoped>
.tab {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e4e7ed;
  margin-bottom: 20px;
  .tab-item {
    height: 50px;
    line-height: 50px;
    width: 180px;
    text-align: center;
    font-size: 13px;
    letter-spacing: normal;
    color: #333333;
    font-family: 微软雅黑, sans-serif;
    font-weight: 400;
    font-style: normal;
    cursor: pointer;
  }
  .tabActive {
    color: rgb(68, 42, 141);
    border-bottom: 2px solid rgb(68, 42, 141);
  }
  // width: 180px;
}
</style>
